package com.作业.第八章作业.HomeWork13;

public class Teacher extends Person{
    private int work_age;

    public Teacher(String name, int age, String sex, int work_age) {
        super(name, age, sex);
        this.work_age = work_age;
    }

    public int getWork_age() {
        return work_age;
    }

    public void setWork_age(int work_age) {
        this.work_age = work_age;
    }

    public String play(){
        return super.play()+"象棋";
    }

    public void teach() {
        System.out.println("我承诺，我会认真教学");
    }

    public String printinfo() {
        return "老师的信息\n"+super.printinfo()+
                "\n工龄=" + work_age +"\n"+"我承诺，我会认真教学\n"+play()
                ;
    }
    String show(){
        return super.show()+" 工龄= "+work_age;
    }
}
